import request from '@/utils/request/request'

const api = {
  get(url, params) {
    return request({
      url,
      method: 'get',
      params
    })
  },
  post(url, data) {
    return request({
      url,
      method: 'post',
      data
    })
  },
  getRestful(url, id) {
    return request({
      url: `${url}/${id}`,
      method: 'get'
    })
  }
}

export default {
  install: (app) => {
    app.config.globalProperties.$api = api
  }
} 